import express from "express"
import { verifyToken } from "../verifyToken.js";

import { addVideo, addView, deleteVideo, getByTag, getVideo, random, search, sub, trend, updateVideo } from "../controllers/video.js";

const router=express.Router();

//创建一个视频
router.post("/",verifyToken,addVideo)
// 修改一个视频
router.put("/:id",verifyToken,updateVideo)
// 删除一个视频
router.delete("/:id",verifyToken,deleteVideo)
// 按照视频id查询视频
router.get("/find/:id",getVideo)
router.put("/view/:id",addView)
router.get("/trend",trend)
router.get("/random",random)
router.get("/sub",verifyToken,sub)
router.get("/tags",getByTag)
router.get("/search",search)

export default router; 